
import type { FormRules } from 'element-plus'
import { reactive } from 'vue'
export const form = reactive({
  businesstype: '',
  companycode: '',
  sitecode: '',
  stationcode: '',
  groupcode: '',
  groupname: '',
  material: '铜',
  capacity: ''
})

export const rules = reactive<FormRules>({
  businesstype: [{ required: true, message: '请选择业务类型' }],
  companycode: [{ required: true, message: '请选择企业' }],
  sitecode: [{ required: true, message: '请选择站点' }],
  stationcode: [{ required: true, message: '请选择电站' }],
  groupcode: [{ required: true, message: '请输入数据网关编号' }],
  groupname: [{ required: true, message: '请输入分组名称' }],
  material: [{ required: true, message: '请选择材质' }],
  capacity: [{ required: true, message: '请输入容量' }]
})
export const saveAdd = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const queryEdit = (id: string) => {
  console.log('id:==', id)
} 
export const saveEdit = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const saveDel = (id: string, callback?: Function) => {
  console.log('id--:', id)
  typeof callback === 'function' && callback()
}
